package com.simple.util;

import java.util.List;
import java.util.Map;

import com.simple.portal.bo.IMenuBO;
import com.simple.portal.vo.MenuVO;
import com.simple.util.common.SpringUtil;

public final class MenuLoad {
    private static final String LOCK = "lock";

    private static MenuLoad instance = new MenuLoad();

    public static MenuLoad getInstance() {
        synchronized(LOCK){
            if(instance == null) {
                instance = new MenuLoad();
            }
        }

        return instance;
    }
    
	public Map<String,MenuVO> getMenuMap(){
    	final IMenuBO menuBO = (IMenuBO) SpringUtil.getBean("menuBO");
    	return menuBO.getAllMenuMap();
    }
	
	public List<MenuVO> findAllMenuVO(){
    	final IMenuBO menuBO = (IMenuBO) SpringUtil.getBean("menuBO");
    	return menuBO.findAllMenuVO();
    }
}
